package com.e3.sysmg.security.client;

import java.util.List;

import com.e3.sysmg.security.model.ModuleModel;
import com.e3.sysmg.security.model.RoleModel;
import com.e3.sysmg.security.model.RoleQC;
import com.e3.web.core.client.RPCServiceHelper;
import com.e3.web.core.client.WebException;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;

public interface RoleRPCService extends RemoteService {
	public static class Util {
		private static RoleRPCServiceAsync instance;
		public static RoleRPCServiceAsync getInstance(){
			instance = (RoleRPCServiceAsync)RPCServiceHelper.getService(RoleRPCService.class.getName());
			if(instance == null){
				instance = GWT.create(RoleRPCService.class);
				RPCServiceHelper.registerServiceEntryPoint(instance);
			}
			return instance;
		}
	}
	
	public List<RoleModel> getRolesByCondition(RoleQC roleQC) throws WebException;
	
	public List<RoleModel> getAllRoles() throws WebException;
	
	public RoleModel newRole(RoleModel roleModel) throws WebException;
	
	public RoleModel modifyRole(RoleModel roleModel) throws WebException;
	
	public void deleteRoles(List<RoleModel> roleModels) throws WebException;
	
	public List<ModuleModel> getAllModulesOfRole(RoleModel roleModel) throws WebException;
	
	public List<ModuleModel> getRoleSelfModules(RoleModel roleModel) throws WebException;
}
